//
//  MineAboutPageViewViewController.m
//  02-徙游记
//
//  Created by fanzhuxian on 2017/7/16.
//  Copyright © 2017年 FanZhuxian. All rights reserved.
//

#import "MineAboutPageViewViewController.h"
#import "MineOpenSourceViewController.h"



@interface MineAboutPageViewViewController ()

@end

@implementation MineAboutPageViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationItem.title = @"关于我们";
    self.view.backgroundColor = RGB(234, 234, 251);
    
    UIImageView * logo = [UIImageView new];
    logo.contentMode = UIViewContentModeScaleAspectFit;
    logo.image = [UIImage imageNamed:@"logo"];
    logo.frame = CGRectMake(DEVICE_SCREEN_WIDTH / 2 - 50, DEVICE_SCREEN_HEIGHT / 2 - 150, 100, 100);
    [self.view addSubview:logo];
    
    UILabel * declarationLabel = [UILabel new];
    declarationLabel.frame = CGRectMake(0, CGRectGetMaxY(logo.frame) + 20, DEVICE_SCREEN_WIDTH, 80);
    declarationLabel.numberOfLines = 0;
    declarationLabel.lineBreakMode = NSLineBreakByCharWrapping;
    declarationLabel.textAlignment = NSTextAlignmentCenter;
    declarationLabel.textColor = [UIColor lightGrayColor];
    
    NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
    NSString * build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
    
    declarationLabel.text = [NSString stringWithFormat:@"%@ (%@) \n©2016 oschina.net.\nAll rights reserved.", version, build];
    [self.view addSubview:declarationLabel];
    
    UILabel * OSLinceseLabel = [UILabel new];
    OSLinceseLabel.frame = CGRectMake(0, CGRectGetMaxY(declarationLabel.frame) + 150, DEVICE_SCREEN_WIDTH, 40);
    OSLinceseLabel.textAlignment = NSTextAlignmentCenter;
    OSLinceseLabel.textColor = [UIColor blueColor];
    OSLinceseLabel.text = @"开源许可";
    OSLinceseLabel.userInteractionEnabled = YES;
    
    [OSLinceseLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickOSLicenseLabel)]];
    [self.view addSubview:OSLinceseLabel];

}

- (void)onClickOSLicenseLabel {

    [self.navigationController pushViewController:[MineOpenSourceViewController new] animated:YES];
}



@end
